package com.tongqu.mapper;

import com.tongqu.protocol.TestUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
@Mapper
public interface TableDao {
    @Select("show tables")
    List<String> findAllTables();

    @Delete("drop table ${table}")
    int dropTable(@Param("table") String table);

    @Select("SELECT CREATE_TIME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='forward' AND TABLE_NAME='${table}'")
    public Date getCreateTableTime(@Param("table") String table);
}
